import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import store from '@/store/index.js' 

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/Home'
  },
  {
    path: '/Home',
    name: 'Home',
    component: Home
  },
  {
    path: '/Goods',
    name: 'Goods',
    component: ()=>import('@/views/Goods.vue')
  },
  {
    path: '/Order',
    name: 'Order',
    component: ()=>import('@/views/Order.vue')
  },
  {
    path: '/Mine',
    name: 'Mine',
    component: ()=>import('@/views/Mine.vue')
  }
]

const router = new VueRouter({
  routes
})

router.beforeEach((to,form,next)=>{
  sessionStorage.removeItem("tabStatus")
  next()
})

export default router
